/*
 * @Author: yumao 123456
 * @Date: 2025-09-19 10:30:07
 * @LastEditors: yumao 123456
 * @LastEditTime: 2025-09-23 14:13:30
 * @FilePath: \龙飞1\src\api\ruleConfig.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

const heimdallrApi = {
  AlarmRulePage: '/heimdallrApi/alarmRule/page',
  RelationWorkflow: '/heimdallrApi/relation/workflow',
  RelationNodeConfig: '/heimdallrApi/relation/nodeConfig',
  AlarmNoticeConfigList: '/heimdallrApi/alarmNoticeConfig/list',
  AlarmRuleCondition: '/heimdallrApi/alarmRule/condition',
  AlarmRuleUpdateStatus: '/heimdallrApi/alarmRule/updateStatus',
  AlarmRuleAdd: '/heimdallrApi/alarmRule/add',
  AlarmRuleUpdate: '/heimdallrApi/alarmRule/update',
  AlarmRuleGet: '/heimdallrApi/alarmRule/get',
  AlarmRuleDelete: '/heimdallrApi/alarmRule/delete',
}
const boundary = '----WebKitFormBoundary' + Math.random().toString(36).substr(2)
export function alarmRulePage(parameter) {
  return request({
    url: heimdallrApi.AlarmRulePage,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
export function relationWorkflow(parameter) {
  return request({
    url: heimdallrApi.RelationWorkflow,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
export function relationNodeConfig(parameter) {
  return request({
    url: heimdallrApi.RelationNodeConfig,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
export function alarmNoticeConfigList(parameter) {
  return request({
    url: heimdallrApi.AlarmNoticeConfigList,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}
export function alarmRuleCondition(parameter) {
  return request({
    url: heimdallrApi.AlarmRuleCondition,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}

export function alarmRuleUpdateStatus(parameter) {
  return request({
    url: heimdallrApi.AlarmRuleUpdateStatus,
    method: 'post',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}

export function alarmRuleAdd(parameter) {
  return request({
    url: heimdallrApi.AlarmRuleAdd,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': `multipart/form-data; boundary=${boundary}`,
    },
  })
}
export function alarmRuleUpdate(parameter) {
  return request({
    url: heimdallrApi.AlarmRuleUpdate,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': `multipart/form-data; boundary=${boundary}`,
    },
  })
}

export function alarmRuleGet(parameter) {
  return request({
    url: heimdallrApi.AlarmRuleGet,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  })
}

export function alarmRuleDelete(parameter) {
  return request({
    url: heimdallrApi.AlarmRuleDelete,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': `multipart/form-data; boundary=${boundary}`,
    },
  })
}
